<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>网上书店</title>
 <#include "/common/inc.html"/>
 <#include "/common/inc_more.html"/>
 <script type="text/javascript">
 	jQuery(function($){
 		cartTotalMoneyAndCount();
	});
 	function logout(){
 		  if (confirm("你确定要退出吗")) {  
 	            location.href="${baseUrl}/logout";  
 	        }  
 	}
 	function cart(){
 		<#if currentUser??>
 		$.dialog("${baseUrl}/cart/list","我的购物车","1000px","550px");
 		<#else>
 		window.location.href="${baseUrl}/login";
 		</#if>
 	}
 	function cartTotalMoneyAndCount(){
 		$.post("${baseUrl}/cart/statistics",{},function(data){
 			if(data.statistic.totalmoney==null){
 				$("#cartTotalMoney").html("0元");
 			}else{
 				$("#cartTotalMoney").html(data.statistic.totalmoney+"元");
 			}
 			$("#cartTotalCount").html(data.statistic.count+"件");
 		});
 	}
 	function addToCart(bid,price){
 		<#if currentUser??>
		$.post("${baseUrl}/cart/save",{bid:bid,totalPrice:price},function(data){
			$.alert(data.msg.msgText,data.msg.msgStatus);
			if(data.msg.msgStatus=="true"){
				cartTotalMoneyAndCount();
			}
		});
		<#else>
 		window.location.href="${baseUrl}/login";
		</#if>
	}
 	function alertMsg(msgText,msgStatus){
 		$.alert(msgText,msgStatus);
 	}
 </script>
 </head>
 <body>
 
 <header class="header">
<nav class="navbar navbar-bookshop navbar-static-top" role="navigation">

    <div class="container">

        <div class="row">

            <div class="col-md-5 hidden-xs hidden-sm">

                <ul class="nav navbar-nav">

                    <li style="border: none;"><a href="${baseUrl}/index">网上书店</a></li>
					
                    <li style="border: none;"><a href="#">关于我们</a></li>
                    <li style="border: none;"><a href="#">配送范围</a></li>

                </ul><!-- /.nav -->

            </div><!-- /.col -->

            <div class="col-md-3 col-xs-10 col-sm-10 navbar-left">



                <p class="text-center"><a href="#"><span class="icon glyphicon glyphicon-earphone"></span> 12345678</a></p>



            </div>

            <div class="col-md-4 col-sm-2">

                <ul class="nav navbar-nav navbar-right">
                	<#if currentUser??>
					<li class="hidden-xs hidden-sm" style="border: none;"><a href="${baseUrl}/order/list?uid=${currentUser.username!}">我的订单</a></li>
					
                    <li class="hidden-xs hidden-sm" style="border: none;"><a href="#" onclick="cart()">购物车</a></li>

                    <li class="hidden-xs hidden-sm" style="border: none;"><a href="contact.html">${currentUser.truename!}</a></li>
                    
                    <li class="hidden-xs hidden-sm" style="border: none;"><a href="#none" onclick="logout()">退出</a></li>

                    <li class="icon icon-small hidden-xs" style="border: none;"><a data-toggle="modal" data-target="#modal-login-big" href="#"><i class="icon fa fa-lock"></i></a></li>

                    <li class="icon hidden-lg hidden-sm hidden-md"><a data-toggle="modal" data-target="#modal-login-small" href="#"><i class="icon fa fa-lock"></i></a></li>
					<#else>
					<li class="hidden-xs hidden-sm" style="border: none;"><a href="#none">游客</a></li>
					<li class="hidden-xs hidden-sm" style="border: none;"><a href="${baseUrl}/login">登陆</a></li>
					</#if>
                </ul><!-- /.nav -->

            </div><!-- /.col -->

        </div><!-- /.row -->

    </div><!-- /.container -->

</nav>
<div class="main-header">

			<div class="container">

				<div class="row">

					<div class="col-xs-12 col-sm-4 col-md-4 top-search-holder m-t-10">

						<!-- ============================================== SEARCH BAR ============================================== -->

<form class="search-form" role="search">

	<div class="form-group">

		<label class="sr-only" for="page-search">搜索</label>

		<input id="page-search" class="search-input form-control" type="search" placeholder="查找 ">

	</div>

	<button class="page-search-button">

		<span class="fa fa-search">

			<span class="sr-only">Search</span>

		</span>

	</button>

</form>

<!-- ============================================== SEARCH BAR : END ============================================== -->					</div><!-- /.top-search-holder -->



					<div class="col-xs-12 col-sm-4 col-md-4 text-center logo-holder">

						<!-- ============================================== LOGO ============================================== -->

<a href="${baseUrl}/index" style="text-decoration: none;">

	<h1 class="logo">网上书店</h1>

	<div class="logo-subtitle">

		<span>书籍是人类进步的阶梯</span>

	</div><!-- /.logo-subtitle -->

</a>

<!-- ============================================== LOGO : END ============================================== -->					</div><!-- /.logo-holder -->



					<div class="col-xs-12  col-md-2 header-shippment hidden-sm m-t-10">

						<!-- ============================================== FREE DELIVERY ============================================== -->

<div class="media free-delivery hidden-xs ">

	<span class="media-left"><img src="${baseUrl}/images/1_delivery-icon.png" height="48" width="48" alt=""></span>

	<div class="media-body">

		<h5 class="media-heading">免费配送</h5>

	</div>

</div>

<!-- ============================================== FREE DELIVERY : END ============================================== -->					</div><!-- /.header-shippment -->



					<div class="col-xs-12 col-sm-4 col-md-2 animate-dropdown1 top-cart-row m-t-10">

						<!-- ============================================== SHOPPING CART DROPDOWN ============================================== -->                              

<ul class="clearfix shopping-cart-block list-unstyled">

    <li class="dropdown">

        <a  class="menu-toggle-right clearfix" href="#" onclick="cart()">

            <span class="pull-right cart-right-block">

                <img src="${baseUrl}/images/2_cart-icon.png" alt="" width="46" height="39">

            </span><!-- /.cart-right-block -->

            <span class="pull-right cart-left-block">

                <span class="cart-block-heading" id="cartTotalMoney"></span>

                <span class="badge badge-important" id="cartTotalCount"></span>

            </span><!-- /.cart-left-block -->

        </a>

    </li>

</ul> <!-- /.list-unstyled --> 

<!-- ============================================== SHOPPING CART DROPDOWN : END ============================================== -->					</div><!-- /.top-cart-row -->

				</div><!-- /.row -->



			</div><!-- /.container -->



		</div>
		<div class="header-nav animate-dropdown">

		<div class="container">			

			<div class="nav-bg-class">

				<!-- ============================================================= NAVBAR PRIMARY ============================================================= -->

<nav class="yamm navbar navbar-primary animate-dropdown" role="navigation">

    <div class="navbar-header">

        <button id="btn-navbar-primary-collapse" type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-primary-collapse">

            <span class="sr-only">Toggle navigation</span>

            <span class="icon-bar"></span>

            <span class="icon-bar"></span>

            <span class="icon-bar"></span>

        </button>

    </div><!-- /.navbar-header -->

    <div class="collapse navbar-collapse" id="navbar-primary-collapse">

        <ul class="nav navbar-nav" id="categories">
        </ul><!-- /.nav -->

    </div><!-- /.collapse navbar-collapse -->   

</nav><!-- /.yamm -->

<!-- ============================================================= NAVBAR PRIMARY : END ============================================================= -->			</div><!-- /.nav-bg-class -->

		</div><!-- /.container -->

	

</div>
</header>